<template>
	<view v-if="show" class="hb-overlay" :style="{zIndex:zIndex,customStyle}" @tap="onClick" @touchmove="noop">
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name: 'hbOverlay',
		props: {
			show: {
				type: Boolean,
				default: false
			},
			customStyle: String,
			duration: {
				type: null,
				default: 300
			},
			zIndex: {
				type: Number,
				default: 1
			}
		},
		methods: {
			onClick() {
				this.$emit('click')
			},
			noop() {

			}
		}
	}
</script>

<style>
	.hb-overlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.7);
	}
</style>
